﻿<h3>
    API - Static - Class</h3>
<hr>
<h4>
    $.class</h4>
    <br />
<br />
<h3>
    API - Static - Class - define</h3>
<hr>
<h4>
    $.class.define(declaration)</h4>
<p>
    @description Define a class.<br>
    @param {function} declaration<br>
    @return {function} Class constructor.
</p>
<h4>
    Example</h4>
<pre>$.class.ns("Joo");

Joo.Pet = $.class.define(function(name) {
	var _name = name;
	var _walkCount = 0;
	var self = {
		walk : function() {
			_walkCount++;
			return name
				+ " has been walked "
				+ _walkCount
				+ " time(s) today.";
		};
	};
	return self;
});

var pet = new Joo.Pet("Taboo");
pet.walk(); // Taboo has been walked 1 time(s) today.
pet.walk(); // Taboo has been walked 2 time(s) today.</pre>
<h3>
    API - Static - Class - defineAsSingleton</h3>
<hr>
<h4>
    $.class.defineAsSingleton(declaration)</h4>
<p>
    @description Define a singleton.<br>
    @param {function} declaration<br>
    @return {function} Singleton instance of class definition.
</p>
<h3>
    API - Static - Class - extend</h3>
<hr>
<h4>
    $.class.extend(superclass, declaration)</h4>
<p>
    @description Define a class that inherits from a superclass.<br>
    @param {function} superclass<br>
    @param {function} declaration<br>
    @return {function} Child class constructor.
</p>
<h4>
    Example</h4>
<pre>Joo.Cat = $.class.extend(Joo.Pet, function(name) {
	var _speak = "Meow";
	var self = {
		speak: function() {
			return "The Cat says: " + _speak;
		};
	};
	return self;
});

var cat = new Joo.Cat("Linq");
cat.walk(); // Taboo has been walked 1 time(s) today.
cat.speak(); // The Cat says: Meow</pre>
<h3>
    API - Static - Class - extendAsSingleton</h3>
<hr>
<h4>
    $.class.extendAsSingleton(superclass, declaration)</h4>
<p>
    @description Define a singleton that inherits from a superclass.<br>
    @param {function} superclass<br>
    @param {function} declaration<br>
    @return {function} Singleton instance of class extension.
</p>
<h3>
    API - Static - Class - is</h3>
<hr>
<h4>
    $.class.is(object, type)</h4>
<p>
    @description Type checks an object.<br>
    @param {object} object<br>
    @param {function} type<br>
    @return {boolean} True if object is derivative of type.
</p>
<h4>
    Example</h4>
<pre>var cat = new Joo.Cat("Linq");
$.joo.isClass(cat, Joo.Pet); // true
$.joo.isClass(cat, Joo.Cat); // true
$.joo.isClass(cat, Joo.Dog); // false</pre>
<h3>
    API - Static - Class - ns</h3>
<hr>
<h4>
    $.class.ns(namespace)</h4>
<p>
    @description Defines namespaces for object delcaration.<br>
    @param {string} namespace<br>
</p>
<h4>
    Example</h4>
<pre>$.class.ns("System.ComponentModel.DataAnnotations");</pre>
